
#import <Flutter/Flutter.h>


typedef void (^ResultCallback)(BOOL isSuccess);

typedef NS_ENUM(NSInteger, PluginResultCode)
{
    CODE_OK = 0,
    CODE_UNKOWN_ERROR = -1,
    CODE_INVALIDED_ARGS = -2,
    CODE_CANCEL = -3,
};


@interface PluginResult : NSObject


@property (nonatomic, strong)  FlutterResult result;

+ (PluginResult*)create:(FlutterResult)result;

- (instancetype)initWithResult:(FlutterResult)result;

- (void)sendOk;

- (void)sendUnkonwError:(NSString*) msg;

- (void)sendCancel:(NSString*) msg;

- (void)sendInvalidedArgs:(NSString*) msg;

- (void)sendCode:(NSInteger) code msg:(NSString*) msg;

- (void)setValue:(NSObject*)value forKey:(NSString *)key;

@end
